package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.util.List;


@TableName("truck_order")//当实体类和表名不一致的时候，用@tablename来指定表名
public class TruckOrder {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long orderId;//关联货运单的id
    private Long carrierId;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    private Integer state;
    private Long driverId;
    private Long truckId;
    private String goods;
    private Float weight;
    private Double unexpectedCost;
    private String location;

    @TableField(exist = false)
    private String driver;

    @TableField(exist = false)
    private String truck;

    @TableField(exist = false)
    private ShippingOrder shippingOrder;

    @TableField(exist = false)
    private List<OperationRecord> operationRecords;

    public TruckOrder(){}
    public TruckOrder(Long orderId, Long carrierId, Long driverId, Long truckId, String goods, Float weight, Date date) {
        this.orderId = orderId;
        this.carrierId = carrierId;
        this.driverId = driverId;
        this.truckId = truckId;
        this.goods = goods;
        this.weight = weight;
        this.createTime = date;
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getCarrierId() {
        return carrierId;
    }

    public void setCarrierId(Long carrierId) {
        this.carrierId = carrierId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Long getDriverId() {
        return driverId;
    }

    public void setDriverId(Long driverId) {
        this.driverId = driverId;
    }

    public Long getTruckId() {
        return truckId;
    }

    public void setTruckId(Long truckId) {
        this.truckId = truckId;
    }

    public String getGoods() {
        return goods;
    }

    public void setGoods(String goods) {
        this.goods = goods;
    }

    public Double getUnexpectedCost() {
        return unexpectedCost;
    }

    public void setUnexpectedCost(Double unexpectedCost) {
        this.unexpectedCost = unexpectedCost;
    }

    public List<OperationRecord> getOperationRecords() {
        return operationRecords;
    }

    public void setOperationRecords(List<OperationRecord> operationRecords) {
        this.operationRecords = operationRecords;
    }

    public Float getWeight() {
        return weight;
    }

    public void setWeight(Float weight) {
        this.weight = weight;
    }

    public ShippingOrder getShippingOrder() {
        return shippingOrder;
    }

    public void setShippingOrder(ShippingOrder shippingOrder) {
        this.shippingOrder = shippingOrder;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getTruck() {
        return truck;
    }

    public void setTruck(String truck) {
        this.truck = truck;
    }
}